<%layout("/eova/layout/default.html",{'title' : '提交档案借阅申请' }){%>
<body>
	<form id="addFormborrow" method="post" class="form">
		<div class="eova-form">

			<div class="eova-form-field" title="借阅用户[login_id]" style="">
				<div class="eova-form-lbl">借阅用户</div>
				<div>
					<div class="eova-text" id="login_id" name="login_id"
						value="${login_id!}" data-options=" disable : true"></div>
				</div>
			</div>

			<div class="eova-form-field" title="机构码[brchcd]" style="">
				<div class="eova-form-lbl">机构码</div>
				<div>
					<div class="eova-text" id="brchcd" name="brchcd" value="${brchcd!}"
						data-options=" disable : true"></div>
				</div>
			</div>

			<div class="eova-form-field" title="档案编号[doc_id]" style="">
				<div class="eova-form-lbl">档案编号</div>
				<div>
					<div class="eova-text" id="doc_id" name="doc_id" value="${doc_id!}"
						data-options=" disable : true"></div>
				</div>
			</div>

			<div class="eova-form-field" title="文件题名[title]" style="width: 98%;">
				<div class="eova-form-lbl">文件题名</div>
				<div>
					<textarea class="eova-texts" id="title" name="title" placeholder=""
						style="width: 758px; height: 20px;; border: 1px solid #95B8E7;"
						readonly="readonly">${title!}</textarea>
				</div>
			</div>

			<div class="eova-form-field" title="借阅开始日期[valid_from]" style="">
				<div class="eova-form-lbl red">借阅开始日期</div>
				<div>
					<div class="eova-time" id="valid_from" name="valid_from" value=""
						data-options="format:'yyyy-MM-dd'
, disable : false"></div>
				</div>
			</div>

			<div class="eova-form-field" title="借阅结束日期[valid_end]" style="">
				<div class="eova-form-lbl red">借阅结束日期</div>
				<div>
					<div class="eova-time" id="valid_end" name="valid_end" value=""
						data-options="format:'yyyy-MM-dd'
, disable : false"></div>
				</div>
			</div>

		</div>
	</form>
	<script>
		$(function() {
			var $form = $('#addFormborrow');
			$form.validator({
				debug : false,
				stopOnError : true,
				focusInvalid : false,
				showOk : false,
				timely : 0,
				msgMaker : false,
				fields : {
					doc_id : {
						rule : "档案编号:required;"
					},
					login_id : {
						rule : "借阅用户:required;"
					},
					title : {
						rule : "文件题名:required;"
					},
					valid_from : {
						rule : "借阅开始日期:required;"
					},
					valid_end : {
						rule : "借阅结束日期:required;"
					},
				}
			});
			$form.on("validation", $.validation);
		});
	</script>
	<script type="text/javascript">
		var $form = $('#addFormborrow');

		var submitNow = function($dialog, $grid, $pjq) {
			var url = "/form/doAdd/borrow";
			$.post(url, sy.serializeObject($form), function(result) {
				if (result.success) {
					//$pjq.messager.alert('提示', result.msg, 'info');
					$.slideMsg("新增档案借阅申请成功！", $pjq);
					if ($grid.context.URL.indexOf('/single_tree') != -1) {
						$grid.treegrid('load');
					} else {
						$grid.datagrid('load');
					}
					$dialog.dialog('destroy');
				} else {
					$.alert($pjq, result.msg);
				}
			}, 'json');
		};
		var submitForm = function($dialog, $grid, $pjq) {
			// nice validator
			$form.isValid(function(isValied) {
				if (isValied) {
					submitNow($dialog, $grid, $pjq);
				}
			});
		};
	</script>
</body>
<%}%>
